# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: T.J. Townsend <blakkheim@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: lillian rose winter <hi@neko.vg>
# Contributor: Evan McCarthy <evan@mccarthy.mn>

pkgname=libretls
pkgver=3.8.1
pkgrel=1
pkgdesc="libtls for OpenSSL"
arch=(loong64 x86_64)
url="https://git.causal.agency/${pkgname}"
license=(ISC BSD MIT)
depends=(openssl)
source=(https://causal.agency/${pkgname}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('3bc9fc0e61827ee2f608e5e44993a8fda6d610b80a1e01a9c75610cc292997b5')
b2sums=('d8f3c178daadcdc3b78683d25a77cd2b20235c77d8ace43fa2c658c77165db6383d8673b7047b66a894e7de5b203c6bc89d226959040f6d93b2675ceee1ba7b7')

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  sed -n '1,/*\//p' tls.c | install -Dm644 /dev/stdin "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
